import { http } from '@/utils/http'
import type { components } from '@/types/ApiInterface'

// 获取门禁权限列表
export const getGatePermissionListAPI = (params: {
  pageSize: number
  page: number
  communityUserStatusId?: string
  communityId?: string
}) => {
  return http.get<{
    list: components['schemas']['GatePermissionListResponse'][]
    total: number
    page: number
    pageSize: number
  }>('/api/gatePermission/list', { params })
}

// 创建或更新门禁权限
export const upsertGatePermissionAPI = (
  params: components['schemas']['GatePermissionUpsertDto'],
) => {
  return http.post('/api/gatePermission/upsert', params)
}
